<!DOCTYPE html>
<html lang="ch">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            width: 200px;
            height: 200px;
        }

        .box1{
            background-color: yellow;
            position: relative;
            top: 100px;
            left: 100px;
            z-index: 1;
            /* 层级 */
        }

        .box2{
            background-color: green;
            /* position: relative; 后来居上  必须要有定位*/
            position: relative;
            z-index: 2;

        }
        /*  z-index:  值越大 层级越大 越靠上 可以設置负数 */
    </style>
</head>

<body>
    <div class = "box1"> 
    </div>
    
    <div class="box2"></div>


</body>

</html>